<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <#assign base=request.contextPath  />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/frame/static/css/style.css">
    <link rel="icon" href="${base}/frame/static/image/code.png">
    <script type="text/javascript" src="${base}/frame/layui/layui.all.js"></script>
    <script src="${base}/js/jquery-1.8.3.min.js"></script>
</head>
<body class="body">
<div class="ziyemianbiju">
       <span style="height: 50px;">
           <div class="layui-input-inline">
                    <input type="text" autocomplete="off" placeholder="开始时间(准确时间)" class="layui-input isNull" id="startTime" name="startTime" style="height: 31px;">
                </div>
                  <div class="layui-input-inline">
                    <input type="text" autocomplete="off" placeholder="结束时间(准确时间)" class="layui-input isNull" id="endTime" name="endTime" style="height: 31px;">
                </div>
                <button class="layui-btn  layui-btn-sm layui-btn-normal" id="seche22">查询</button>
            </span>
    <table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/javascript">
layui.use(['laydate','form','table'], function(){
	var laydate = layui.laydate;
 	var form = layui.form
 	var table = layui.table;
  table.render({
    even: true,//开启隔行背景
	size: 'sm',//小尺寸的表格
	elem: '#test',
    toolbar: '#toolbarDemo',
	url: '${base}/comMoneyInfo/RechargeList',
	title: '用户数据表',
	cols: [[
        {field:'ptName', title: '企业名称',align: 'center'}
        ,{field:'userName', title: '账户',align: 'center'}
        ,{field:'addmoney', title: '充值金额',align: 'center'}
        // ,{field:'toeleUserName', title: '平台用户',align: 'center'}
        ,{field:'money', title: '剩余金额',align: 'center',
            templet: function(d){
                if (d.money<=500){
                    return '<span style="color: #c00;">'+ d.money +'</span>'
                }
                return '<span>'+ d.money +'</span>'
            }}
        ,{field:'creatTime', title: '充值时间',align:'center'}
      // ,{field:'xxxx', title: '订单号',align:'center'}
    ]]
    ,id: 'testReload'
      ,height:480
      ,page: {
          layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
          ,theme: '#9AC747'
          ,limit: 10
      }
  });

});
//键盘事件
$("body").bind("keydown",function(e){
    // 兼容FF和IE和Opera
    var theEvent = e || window.event;
    var code=theEvent.keyCode || theEvent.which || theEvent.charCode;
    if (code==13) {
        //回车执行查询
        $("#seche22").click();
    }
});

$('#seche22').on('click',function () {
    var formData={};
    formData.startTime=$("#startTime").val();
    formData.endTime=$("#endTime").val();
    var table = layui.table;
    table.reload(
            'testReload', {
                url: '${base}/comMoneyInfo/query',
                where:{param:JSON.stringify(formData)},
            });

})




</script>
</body>
</html>